package com.adingxiong.cft.errors;

import com.adingxiong.cft.result.IErrorCode;
import com.adingxiong.cft.result.RetCode;

/**
 * @ClassName ApiException
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/9/22 10:07
 **/
public class ApiException extends RuntimeException
{
    private IErrorCode errorCode;

    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public IErrorCode getErrorCode() {
        return errorCode;
    }
}
